package funs

import "fmt"

var DefaultGolangTemplateTable = fmt.Sprintf(`package models

{{$ilen := len .Imports}}{{if gt $ilen 0}}import (
	{{range .Imports}}{{.Name}} "{{.Path}}"
	{{end}}
){{end}}


type {{TableMapper .Table.Name}} struct {
{{$table := .Table}}{{range $table.ColumnsSeq}}{{$col := $table.GetColumn .}}	{{ColumnMapper $col.Name}}	{{Type $col}} %s{{Json $table $col}} {{Tag $table $col}}%s
{{end}}
}

func (m *{{TableMapper .Table.Name}}) TableName() string {
	return "{{.Table.Name}}"
}
`, "`", "`")
